OneMore CLI
May 28, 2026
Last updated on July 31, 2026
The OneMore CLI (OneMoreCli.exe) is a companion tool that exposes a selection of OneMore commands as a scriptable command-line executable. It is capable of running either alongside OneNote or even when OneNote is not running at all, presuming OneNote is installed and you have notebooks you can access.
It can run interactively, prompting you for input. Or it can run with a full set of command line arguments making it suitable for use from PowerShell, batch files, or any other shell script.
How to Define an Alias
OneMoreCli.exe is distributed as part of the OneMore installation as of OneMore 7.1.0. While you can run it directly from the install path, you may want to create a more convenient way of running it from any path. For PowerShell users, you can add this function to your $profile script:
function Start-OneMore
{
[CmdletBinding()]
[Alias("onemore")]
param(
[Parameter(ValueFromRemainingArguments = $true)]
[string[]]$Args
)
$exe = "$($env:ProgramFiles)\River Software\OneMore\OneMoreCli.exe"
& $exe @Args
}
Usage Synopsis
Interactive mode:
PS> onemore
Script mode:
PS> onemore --help # list all commands
PS> onemore <command> --help # parameter reference for one command
PS> onemore <command> [--param value ...] # non-interactive
Neither command names nor parameters are case-sensitive.
Exit codes:
- 0 = success
- 1 = error
Parameters
The first parameter is usually the command name. This is not case-sensitive.
Additional parameters are specified as either key/value pairs or just a key to enable an option. Keys are specified using the form --key. Single word values do not need quotes, but values containing spaces or other special characters will need quotes.
Common Parameters
- notebook specifies the name of the notebook
- section specifies the name of the section. This can include section groups as well, delimited by a forward slash, such as
PS> onemore export --notebook Colors --section "hues/Sky Blue"
- page specifies the name of the page. If it includes spaces, it must be in quotes.
The combined path expressed by --notebook and --section, and optionally --page, must be a fully resolved absolute path, not a relative path.
|
Stop a Running Command
Press Ctrl+C to terminate the currently running command. If you are running a command that is processing multiple pages, such as Export, the background processing will terminate after the currently processing page is completed. Depending on the size of that page, it could be immediate, or it could take a minute or two.
═══════════════════════════════════════════════════════════════════════════════════════════════
Commands
AddHashtag
Add hashtags to the tag bank on one or more pages.
PS> onemore addhashtags --tags <string> --notebook <string> [--section <string>] [--page <string>]
Where --tags is a space-separated list of hashtags to add, e.g., "#work #project"
ApplyStyles
Apply the current style theme to one or more pages.
PS> onemore applystyles --notebook <string> [--section <string>] [--page <string>]
Archive
Archive all pages of a notebook or section as individual HTML files and compress to a zip file
PS> onemore archive --notebook <string> [--section <string>] --outfile <string>
Where --outfile specifies the path, with file name, of the output zip file.
Note that the archive command needs OneNote running, so will start it if it is not yet running.
ClearBackground
Clear background color from text and table cells on a page
PS> onemore clearbackground --notebook <string> [--section <string>] [--page <string>]
ClearLog
Clear the OneMore log file.
PS> onemore clearlog
ConditionalFormat
Apply a style to text on a page matching a regular expression
PS> onemore conditionalformat --regex <string> --style <string> [--notebook <string>] [--section <string>] [--page <string>] [--pageId <string>] [--custom]
--regex is required, specifies the regular expression pattern to match
--style is required, specifies the name of the built-in or custom style to apply
--custom is an optional switch that, when specified, treats the style name as a custom OneMore style instead of a built-in OneNote style
CreateJournal
Generate a set of dated journal pages for a given month.
PS> onemore createjournal --notebook <string> [--sectiongroup <string>] [--section <string>] [--title <string>] [--year <integer>] [--month <string>] [--format <string>] [--weekdays] [--name <string>] [--tags <string>] [--output <file>]
--notebook is required, specifies the name of the journal notebook
--sectiongroup is optional, specifies the name of a section group in which to create a new section (if --name is given)
--section is optional, specifies the name of the section to append pages to (if --name is not given)
--title is optional, title to append to page names, default is Journal
--year is optional, year of journal entries, default is current year
--month is optional, month of journal entries, default is current month
--format is optional, format string, default is long date per culture; may be one of: dddd, MMMM d, yyyy or MMMM d, yyyy or MMM d, yyyy or yyyy-MM-dd
--weekdays is optional flag, specifies weekdays only, default is full week
--name is the customized name of new section to create, default is to append to named --section
--tags is optional, comma-separated list of hashtags to add to every page
Diagnostics
Report diagnostic information about OneNote and OneMore.
PS> onemore diagnostics [--windows]
Where --windows returns only structured JSON data describing open OneNote windows.
DisableSpellCheck
Disable spell checking on one or more pages
PS> onemore disablespellcheck --notebook <string> [--section <string>] [--page <string>]
EnableSpellCheck
Enable spell checking on one or more pages
PS> onemore enablespellcheck --notebook <string> [--section <string>] [--page <string>]
Embed
Refresh all embedded page content within the specified scope.
PS> onemore embed --notebook <string> [--section <string>] [--page <string>] --refresh
Where --refresh is a required parameter
Export
Export pages to a folder in the specified format.
PS> onemore export --notebook <string> [--section <string>] [--page <string>] [--pageId <string>]
[--backup] --outpath <string> --format <string>
--pageId specifies the direct page ID, overrides --notebook / --section / --page
--outpath specifies a folder to which the output file is written
--format may be specified as one of: HTML, PDF, Word, XML, Markdown, or OneNote
When both --notebook and --section are specified, the specified page or all pages in that section are exported to the output path.
When only --notebook is specified, a folder structure is created representing the section/section group hierarchy, where sections are named with parenthesis such as "(section)" and section groups are named with square brackets such as "[section-group]".
--backup is a special case that exports all specified sections to individual .one files, rather than individual pages. This overrides the --page parameter. It can be used with either --notebook or both --notebook and --section. The --format defaults to OneNote.
ExportFavorites
Export entire favorites collection to a JSON file.
PS> onemore exportfavorites --file <string>
Where --file specifies the path of the JSON file to create.
ExportLayouts
Export entire layouts collection to a JSON file.
PS> onemore exportlayouts --file <string>
Where --file specifies the path of the JSON file to create.
GetHierarchy
Get the hierarchy of notebooks, sections, and pages as an XML hierarchy fragment. The XML is written to stdout or can be piped to an output file of your choosing, e.g., … | Out-File foo.xml.
PS> onemore gethierarchy [--notebook <string>] [--section <string>] | --books
With no parameters, the XML includes all notebooks with their sections.
With the --notebook parameter, the XML includes that notebook with its sections.
With both --notebook and --section, the XML includes that section with its pages.
If --books is specified, overrides all other parameters, returning a JSON collection of notebook properties.
|
GetPage
Get the full XML content of the specified page. The XML is written to stdout or can be piped to an output file of your choosing, e.g., … | Out-File foo.xml.
PS> onemore getpage --notebook <string> --section <string> [--page <string>|--current] [--output <string>]
Specify either --page with a page name or --current for the currently viewed page.
--output ensures that output is written to a properly encoded file. If there are encoding concerns in piped output, use the --output parameter rather than piping to a file.
Goto
Navigate OneNote to a specific page or object.
PS> onemore goto --pageId <string> [--objectId <string>]
GotoCommand is also available through the protocol handler:
onemore://GotoCommand/<pageId>[/objectId]
ImportFavorites
Import favorites from a JSON file and merge into your existing favorites collection.
PS> onemore importfavorites --file <string>
Where --file specifies the path of the JSON file to read.
Existing favorites are not touched. Duplicate folders and favorites are not allowed, so any duplicates are ignored.
ImportLayouts
Import layouts from a JSON file and merge into your existing layouts collection.
PS> onemore importlayouts --file <string>
Where --file specifies the path of the JSON file to read.
Existing layouts with the same name will be rewritten.
IndexModified
List pages modified on a given date, across all notebooks, and create a new index page to list them.
PS> onemore indexmodified --date <string> --notebook <string> --section <string>
--date specifies a date to search for, any valid date format, e.g. 2026-07-24
--notebook is the name of a notebook where the index page will be created
--section is the name of the section where the index page is created
InsertToc
Insert or update a table of contents in the specified page
PS> onemore inserttoc --notebook <string> --section <string> --page <string> [--refresh]
LoadStyles
Load a style theme by name. This can be used in conjunction with the ApplyStyles command. Imagine loading and applying a different style theme for each notebook or each section.
PS> onemore loadstyles --theme <string>
--theme specifies the name of the theme to load, e.g. Orange
OpenLog
Open the OneMore log file in the default text editor.
PS> onemore openlog
PutPage
Write page XML from a file to a OneNote page.
PS> onemore putpage --notebook <string> --section <string> [--page <string>] --infile <string> --force
If page is specified then it will attempt to either create a page of that name, or if --force is specified, will overwrite an existing page of that name.
|
Recalculate
Recalculate formula table cells on one or more pages
PS> onemore recalculate --notebook <string> [--section <string>] [--page <string>]
RemoveAuthors
Remove author annotations and editBy attributes from one or more pages
PS> onemore removeauthors --notebook <string> [--section <string>] [--page <string>]
RemoveCitations
Remove auto-generated web clipping citations from one or more pages
PS> onemore removecitations --notebook <string> [--section <string>] [--page <string>]
RemoveEmpty
Collapse consecutive empty lines; optionally remove all empty lines from one or more pages
PS> onemore removeempty --notebook <string> [--section <string>] [--page <string>] [--all]
Where --all specifies removal of all empty lines instead of keeping one between paragraphs
RemoveHashtag
Remove hashtags from the tag bank on one or more pages.
PS> onemore removehashtags --notebook <string> [--section <string>] --tags <string>
Where --tags is a space-separated list of hashtags to add, e.g., "#work #project"
Blank tag banks are removed
RemoveInk
Remove all ink drawings and annotations from one or more pages
PS> onemore removeink --notebook <string> [--section <string>] [--page <string>]
RemoveTags
Remove all tags from one or more pages, except reminder-linked tags
PS> onemore removetags --notebook <string> [--section <string>] [--page <string>]
RestoreAutosize
Restore auto-sizing behavior of manually resized containers on one or more pages
PS> onemore restoreautosize --notebook <string> [--section <string>] [--page <string>]
RestoreLayout
Restore all windows of a named layout
PS> onemore restorelayout--name <string>
SaveLayout
Save all open OneNote windows as a named layout
PS> onemore savelayout--name <string>
Search
Search for pages matching a query across a notebook, section, or page and return results as XML. The XML is written to stdout or can be piped to an output file of your choosing, e.g., … | Out-File foo.xml.
PS> onemore search --notebook <string> [--section <string>] [--page <string>] --query <string>
query specifies the search query as described in Search Commands.
SearchHashtags
Search for hashtags matching a query
PS> onemore searchhashtags [--notebook <string>] [--section <string>] [--page <string>] --query <string> [--allTags]
--query specifies the search query as described in Hashtag Commands
--allTags indicates that, for each page that matches the query, all paragraphs with any tags are reported
SearchTitles
Search for pages matching a query across a notebook, section, or page
PS> onemore searchtitles --query <string> [--notebook <string>]
--query specifies the search query as described in Search Commands
--notebook can specify a notebook or \\ for the current notebook; default is all notebooks
Sync
Sync one or all loaded notebooks to storage. This is the same as running the built-in sync commands. Exposing it to the CLI lets you run it on-demand or schedule it nightly to sync team notebooks.
PS> onemore sync --notebook <string>
--notebook can specify the name of a single notebook, or asterisk (*) to sync all notebooks
ToggleDttm
Show or hide date/time stamps on one or more pages.
PS> onemore toggledttm --notebook <string> [--section <string>] [--page <string>] --visibility show|hide
Where --visibility specifies whether to show or hide date/time stamps
Trim
Trim leading or trailing whitespace from page text
PS> onemore trim --notebook <string> [--section <string>] [--page <string>] [--leading]
Where --leading specifies whether to trim leading whitespace or trailing whitespace; default is to trim trailing whitespace.
#omwiki #ombasics
© 2020 Steven M Cohn. All rights reserved.
Please consider a sponsorship or one-time donation to support ongoing development
Created with OneNote.